package Homework05;

public class Teacher extends Staff{
    private double daySal;//classSal，课时费
    private int day;//classDay，一年上课次数

    public Teacher(String name, double sal) {
        super(name, sal);
    }

    public double getDaySal() {
        return daySal;
    }

    public void setDaySal(double daySal) {
        this.daySal = daySal;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    //重写打印工资的方法
    @Override
    public void printSal() {//老师不能复用super.printSal()
        System.out.print("教师 ");
        System.out.println(getName() + "工资为" + (getSal() + getDaySal() * getDay()));
    }
}
